home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1986 November
/
Ahoy_Magazine_86-11_1986_Double_L.d64
/
Date Ditty 2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
636b
|
18 lines
0 print"[147]":poke53280,6:poke53281,1:poke646,0
1 print" commodares....date ditty #2 ":print:print
2 rem date ditty
3 rem solution by
4 rem karen middaugh
5 rem
10 dim k(12):for i=1 to 7:read d$(i):next:for i=1 to 12:read k(i):next
20 input "input year: 19";y
30 input"input month (1-12): ";m :if m<1 or m>12 then 30
40 input "input day: ";d :if m=2 and d>28 and (y/4<>int(y/4) or y=0) then 40
50 if (m=4 or m=6 or m=9 or m=11) and d>30 then 40
60 if d<1 or d>31 or (m=2 and d>29) then 40
70 l=int((y+3)/4):da=6+y+l+k(m)+d :if int(y/4)=y/4 and m>2 then da=da+1
75 if y=0 and m<3 then da=da+1
80 if da>7 then da=da-7 :goto 80
90 print m"/"d"/"y" is a "d$(da)"day"
100 data mon,tues,wednes,thurs,fri,satur,sun,0,3,3,6,1,4,6,2,5,7,3,5